package com.demo.util;

import java.io.IOException;

import org.apache.lucene.document.Document;
import org.apache.lucene.index.IndexWriter;
import org.apache.lucene.index.IndexWriterConfig;
import org.apache.lucene.util.Version;

public class IndexUtil {
	public static void write() throws IOException {
		IndexWriter writer = new IndexWriter(null, new IndexWriterConfig(Version.LUCENE_45, null));
		Document doc = new Document();
		// doc.add(new Field("title", "Lucene introduction", Field.Store.YES, Field.Index.ANALYZED));
		// doc.add(new Field("content", "Lucene works well", Field.Store.YES, Field.Index.ANALYZED));
		writer.addDocument(doc);
		writer.close();
	}

}
